// public api for go application using koala
package koala

import (
	"github.com/v2pro/koala/gateway/gw4go"
	"github.com/v2pro/koala/internal"
)

// Start koala for record or replay, put this in the first line of main()
func Start() {
	gw4go.Start()
}

// SetDelegatedFromGoRoutineId should be used when this goroutine is doing work for another goroutine,
// for example multiplex protocol, the request is generated in one goroutine, but sent out from another one.
// Tracking the work delegation chain is required to record or replay session.
func SetDelegatedFromGoRoutineId(goid int64) {
	internal.SetDelegatedFromGoRoutineId(goid)
}

// GetCurrentGoRoutineId get goid from the g
func GetCurrentGoRoutineId() int64 {
	return internal.GetCurrentGoRoutineId()
}
